<template>
	
	<view>
		<navigator url='../page2/page2?a=1&b=2' open-type="switchTab">去page2页面</navigator>
		<navigator url='../home/home' open-type="switchTab">去home页面</navigator>

		<button @click="go">去page2页面</button>
		
		<button @click="save">存储数据</button>
		<button @click="del">删除数据</button>
		<button @click="clear">清空数据</button>
		
		<navigator url="../http/http">跳转</navigator>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			clear(){
				uni.clearStorage();
			},
			del(){
				/* uni.removeStorage({
					key:'name',
					success(){}
				}) */
				uni.removeStorageSync('name')
			},
			save(){
				/* uni.setStorage({
					key: 'name',
					data:{a:1,b:2},
					success: function () {
						console.log('success');
					},
					fail(){
						
					}
				}); */
				uni.setStorageSync('name','bbb')
			},
			go(){
				uni.navigateTo({
					url:'/pages/page2/page2?a=3&b=10'
				})
			}
		}
	}
</script>

<style>

</style>
